from django.conf.urls.defaults import patterns, include
from os import path


# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    (r'^media/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': path.join(path.dirname(__file__), 'media')}),
)

urlpatterns += patterns('pgpauth.views',
    # Example:
    # (r'^jj/', include('jj.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/(.*)', admin.site.root),

    (r'^$', 'loginPage'),
    (r'^pgplogin/$', 'loginByPGP'),
    (r'^logout/$', 'logout'),

    (r'^profile/$', 'selectProfile'),

    (r'^publickey/list/$', 'selectAllPublicKey'),
    (r'^publickey/page/$', 'selectUploadPublicKeyPage'),
    (r'^publickey/create/$', 'createPublicKey'),

    (r'^account/create/(?P<publickey_id>[0-9]+)/$', 'selectNewAccountPage'),
    (r'^account/create/$', 'createAccount'),

    (r'^publickey/create/(?P<user_id>[0-9]+)/$', 'createPublicKeyByAdd'), # user can add more the one public key
)
